package com.lcredu.mapper;

import com.lcredu.entity.Person;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author 黎长容
 * @date 2025-07-31 19:29
 */
public interface PersonMapperAnnotation {
    @Select(" select * from person where id = #{id} ")
    @Results({
            @Result(property = "id", column = "id", id = true),
            @Result(property = "name", column = "name"),
            @Result(property = "card", column = "card_id",
                    one = @One(select = "com.lcredu.mapper.IdenCardMapperAnnotaion.getIdenCardById"))
    }
    )
    public Person getPersonById(Integer id);
}
